<?php

function redirect($url){
    ?>
        <script language="javascript" type="text/javascript">
<!--
window.location.replace("<?php echo($url); ?>");
-->
</script>
    <?php
}




if(empty($_COOKIE['language']) OR $_COOKIE['language']=="en"){
    $lang="fr";
}
else{
    $lang="en";
}
$timestamp=time()+3600*24*15;
setcookie("language", $lang, $timestamp);
redirect($_SERVER['HTTP_REFERER']);

?>
